Imports System.Data.SqlClient
Imports Bussines.entity
Public Class parametroDAL
    Dim cn As New conexion
    Dim BEParam As parametroBE
    Public Function ListarParametro(ByRef Param As String) As parametroBE
        Dim dt As New DataTable
        Dim cmd As New SqlCommand()
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "sp_BuscarParam"
        cmd.Parameters.Add(New SqlParameter("@Param", SqlDbType.VarChar)).Value = Param
        Try
            cmd.Connection = cn.abrir()
            Dim dataRead As IDataReader
            dataRead = cmd.ExecuteReader()
            While dataRead.Read
                BEParam = New parametroBE(dataRead("IDPARAM"), dataRead("NOMPARAM"), dataRead("VALORPARAM"))
            End While
            dataRead.Close()
            dataRead.Dispose()
            cn.Cerrar()
            Return BEParam
        Catch ex As Exception
            Return Nothing
        Finally

        End Try

    End Function
End Class
